import request from "../../utils/request";

// 查询支付类型列表
export function listPayType(component) {
  return request.post("/pay/type/list").then((res) => {
    if (component) {
      component.types = res.data;
    }
    return res;
  });
}

export function listPayTypeJSON(component) {
  return request.post("/pay/type/list").then((res) => {
    let types = res.data;

    let json = {};

    types.forEach((element) => {
      json[element.id] = element.typeName;
    });

    component.payType = json;

    console.log("component.data", json);

    return res;
  });
}
